
/*
 * @Description: 序列管理 - 接口
 * @Author: DSY
 * @Date: 2022-05-15 18:18:40
 * @LastEditors: DSY
 * @LastEditTime: 2022-05-15 18:18:40
 */

import { $get, $post, $put } from '/@/utils/http'
import { ContentTypeEnum } from '/@/constant/http'
import {
  SequenceModel,
  SequencePageParams,
  SequencePageResultModel,
  SequenceResultModel
} from './model/sequenceModel'

/**
 * 分页查询
 */
export const apiSequenceSearch = (searchParams: SequencePageParams) =>
  $get<SequencePageResultModel>({
    url: '/system/twbSequence/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiSequenceGetById = (id: string) =>
  $get<SequenceResultModel>({
    url: '/system/twbSequence/getById',
    params: { id: id }
  })

/**
 * 保存信息
 */
export const apiSequenceSave = (saveParams: SequenceModel) =>
  $post<SequenceResultModel>({
    url: '/system/twbSequence/save',
    contentType: ContentTypeEnum.json,
    params: saveParams
  })

/**
 * 更新信息
 */
export const apiSequenceUpdateById = (updateParams: SequenceModel) =>
  $put<SequenceResultModel>({
    url: '/system/twbSequence/updateById',
    contentType: ContentTypeEnum.json,
    params: updateParams
  })

/**
 * 批量删除信息
 */
export const apiSequenceBatchDeleteByIds = (ids: string) =>
  $post<SequenceResultModel>({
    url: '/system/twbSequence/batchDeleteByIds',
    params: { ids: ids }
  })

/**
 * 批量逻辑删除
 */
export const apiSequenceLogicBatchDeleteByIds = (ids: string) =>
  $post<SequenceResultModel>({
    url: '/system/twbSequence/logicBatchDeleteByIds',
    params: { ids: ids }
  })
